﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ShortVoice : MonoBehaviour
{
    public static ShortVoice instance;
    public bool IsPlay;
    
    void Start()
    {
        instance = this;
    }

    public void PlayVoice(string name,float volume=1)
    {
        if (!IsPlay)
        {
            AudioClip clip = Resources.Load<AudioClip>("Voice/" + name);
            //播放短音效
            AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position, volume);
        }
        
    }
}
